import request from '@/utils/request.js';


/**
 * 发送注册短信API
 * @param {Object} data
 */
export function smsApi(value){
  
  const data= { 'phone': value}
  
  return request({
    url: '/anon/sms/register',
    method: 'post',
    data: data
  })
}

/**
 * 查询商家手机号是否存在
 * @param {Object} value
 */
export function merchandiserPhoneApi(value){
  return request({
    url: '/anon/sms/valid/'+value,
    method: 'get'
  })
}


/**
 * 验证码有效效性API
 * @param {Object} data
 */
export function smsValidatorApi(form){
  
  const data= { 
    'phone': form.loginName,
    'code': form.code
    }
  
  return request({
    url: '/anon/sms/validate',
    method: 'post',
    data: data
  })
}
